<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.css" rel="stylesheet" />
	</head>

<style>
	a,.mui-title{
		color:#FFFFFF;
	}
	*{
		font-family:PingFang-SC-Medium;
	}
	.mui-bar{
		background: #FE635F;
	}
	
	.bianji{
		position: absolute;
		right: 10px;
		line-height: 44px;
		font-size:12px;
        font-weight:400;
        color:rgba(255,255,255,1);
	}
	.mui-content{
		position: relative;
		float: left;
		width:100%;
		height: 100%;
	   padding:10px  15px ;
	   background: #FFFFFF;
	   display: inline-block;
	   
	}
	.ses{
		position: relative;
		float: left;
		width: 60px;
		height: 85px;
		margin-left: calc((100% - 300px) / 5);
		margin-top: 20px;
	}
	
	.ses>.renwu{
		width: 60px;
		height: 60px;
		border-radius: 50%;
	}
	.inbox{
		position: absolute;
        left: 40px;	
		top: 0px;
		width: 20px;
		height: 20px;
	}
	.names{
		position: relative;
		float: left;
		width: 100%;
		height: 25px;
		line-height: 25px;
		font-size: 13px;
		text-align: center;
        font-weight:400;
        color:rgba(102,102,102,1);
	}
	.mui-input-row{
		clear: none ;
	}
	
	a:active{
	}
		body{
	background-color: #FFFFFF;
	}
</style>
	<body>
	  <header class="mui-bar mui-bar-nav">
	  	<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	  	<h1 class="mui-title">群成员</h1>
		<div  class="bianji">编辑</div>
	  </header>
	 <div class="mui-content">
		 
<!-- <div class="mui-input-row mui-checkbox ses ">
    <img  class="renwu" src="../image/touxiangmy.png" />
     <img   style="display:none" state=0 class="inbox" src="../image/select.png" />
	<div  class="names">李雪</div>
</div>

 <div class="mui-input-row mui-checkbox ses ">
    <img  class="renwu" src="../image/touxiangmy.png" />
     <img style="display:none"  state=0 class="inbox" src="../image/select.png" />
	<div  class="names">李雪</div>
</div> -->

	 </div>
	</body>
	
	<script src="../js/mui.js"></script>
	<script src="../js/jquery-3.1.1.min.js"></script>
		<script type="text/javascript">
			mui.plusReady(function(){
				var url = plus.storage.getItem('url');
				var user = plus.storage.getItem('user');
				user = JSON.parse(user);
				var web = plus.webview.currentWebview();
				var qunid = web.qunid;
				// mui.alert(qunid)
				mui.post(url+'/juyou/Grouping/getquninfo',{token:user.token,qunid:qunid},function(res){
					if(res.code==200){
						var str = '';
						mui.each(res.data,function(i,v){
							str+='<div class="mui-input-row mui-checkbox ses ">'+
										'<img  class="renwu" src="'+v.user.touxiang+'" />'+
										 '<img   style="display:none" data-id="'+v.user.id+'" state=0 class="inbox" src="../image/select.png" />'+
										'<div  class="names">'+v.name+'</div>'+
									'</div>';
						})
						$(".mui-content").append(str);
					}else{
						mui.toast(res.msg);
					}
				})
				
				
				
				mui.init({
					beforeback: function() {　　　　
					var list = plus.webview.currentWebview().opener();　　　　
						  //refresh是A页面自定义事件
					mui.fire(list, 'refresh');
						 //返回true,继续页面关闭逻辑
					return true;
					},
				});
				var height = document.body.clientHeight;
				$(".mui-content").css("height", height)
				//是否删除操作
				$(document).on("click",".inbox",function(){
				var state=$(this).attr("state");
				if(state==0){
					$(this).attr("state","1")
					$(this).attr("src","../image/selectd.png")
				}else{
					$(this).attr("state","0")
					$(this).attr("src","../image/select.png")
				}
				})
				
				
				//点击编辑
					$(document).on("click",".bianji",function(){
						var value=$(this).text();
						if(value=="编辑"){
							$(this).text("踢除")
							$(".ses .inbox").css("display","block")
						}else{
							var userid = [];
							var obj = $(".inbox");
							mui.each(obj,function(i,v){
								if($(v).attr('state')==1){
									userid.push($(v).attr('data-id'));
								}
							})
							if(userid.length==0){
								mui.toast('请选择要踢除的人');
								$(this).text("编辑")
								$(".ses .inbox").css("display","none")
								return;
							}
							// plus.nativeUI.showWaiting();
							mui.post(url+'/juyou/Grouping/delqunren',{token:user.token,qunid:qunid,userid:userid},function(res){
								if(res.code==200){
									mui.toast(res.msg);
									setTimeout(function(){
										window.location.reload();
									},1500)
									
								}else{
									mui.toast(res.msg);
								}
							})
							// 这里执行踢人操作
							// $(this).text("编辑")
							// $(".ses .inbox").css("display","none")
							
						}
						
					})
			})
	</script>

</html>
